package com.gwq.computed;

public class Exercise {

    private static final short OPERATION_NUMBER=50;
    private static final short COLUMN_NUMBER=5;

    private BinaryOperation operationList[] = new BinaryOperation[OPERATION_NUMBER];

    public void generateBinaryExercise(){
        BinaryOperation anOperation,opCreator = new BinaryOperation();
        for(int i=0;i<OPERATION_NUMBER;i++){
            anOperation = opCreator.generateAdditionOperation();
            while (contains(anOperation,i-1)){
                anOperation = opCreator.generateAdditionOperation();
            }
            operationList[i] = anOperation;
        }
    }

    private boolean contains(BinaryOperation anOperation,int length){
        boolean found = false;
        for(int i=0;i<=length;i++){
            if(anOperation.equals(operationList[i])){
                found = true;
                break;
            }
        }
        return found;
    }


}
